package org.iwidget.model.javascript;
import org.iwidget.desktop.model.WidgetElement;
import org.mozilla.javascript.*;
/**
 *
 * @author Muhammad Hakim A
 */



public class IwidgetWidgetClass extends ScriptableObject
{

    public IwidgetWidgetClass()
    {
    }

    public String getClassName()
    {
        return "iWidgetUnknownClass";
    }

    public WidgetElement getWidget()
    {
        Scriptable scope = ScriptableObject.getTopLevelScope(this);
        Object obj = scope.get("widget", scope);
        return (WidgetElement)Context.toType(obj, org.iwidget.desktop.model.WidgetElement.class);
    }

    public String getWidgetName()
    {
        WidgetElement widget = getWidget();
        return widget.getName();
    }

    private static final long serialVersionUID = 0x2d31313737343039L;
}